The File I/O API > Verifying that DWfile is installed |
![]() ![]() ![]() |
Verifying that DWfile is installed
To access the functions in the DWfile library, the library must be present in the Configuration/JSExtensions folder and loaded by Dreamweaver. Because DWfile did not ship with Dreamweaver 2 (it was available as a separate download that the user had to install), you should verify that the library is available before calling any of its functions. You can do this by checking the typeof(DWfile)
. If DWfile does not exist, typeof(DWfile)
returns undefined
. For example, if you are using DWfile in the context of a command, you might check for the existence of DWfile as part of the canAcceptCommand()
function:
// Returns true if typeof(DWfile) is not undefined, false otherwise. function canAcceptCommand(){ return (typeof(DWfile) != "undefined"); }
![]() ![]() ![]() |